﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharedUtils
{
    public class Node : IEquatable<Node>
    {
        public String name { get; set; }
        public List<Entity> entities { get; set; }
        public Camera2d camera { get; set; }

        public Node(String name)
        {
            this.name = name;
            entities = new List<Entity>();
        }

        public override string ToString()
        {
            return name;
        }

        public bool Equals(Node other){            
            for (int i = 0; i < entities.Count; i++)
            {
                bool entIEqual = entities[i].Equals(other.entities[i]);
                if (!entIEqual)
                {
                    return false;
                }
            }

            return name.Equals(other.name) && camera == other.camera;
        }
    }
}
